#include "widget.h"
#include "ui_widget.h"
#include <QIcon>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QIcon icon(":/love.jpg");
    setWindowIcon(icon);
   setWindowTitle("Love");
   ui->label->setText("1");
//   setWindowOpacity(0.6);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()    //+
{
    float set=this->windowOpacity();
    ui->label->setNum(set);
    if(set>=0.0)
    {
           set+=0.1;
           this->setWindowOpacity(set);
    }
    else
        return;
}

void Widget::on_pushButton_2_clicked()      //-
{
    float set=this->windowOpacity();
    ui->label->setNum(set);
    if(set<=1.0)
    {
           set-=0.1;
           this->setWindowOpacity(set);
    }
    else
        return;
}
